//
//  AFAppDotNetAPIClient.h
//  NTWK
//
//  Created by 张良 on 15/10/26.
//  Copyright © 2015年 ZhuJia. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "AFHTTPSessionManager.h"
#import "JSONHelper.h"

typedef enum : NSUInteger {
    eJsonDefault = -1000,
    eJsonNil,
    eJsonNull,
    eJsonNotDictionary
} CustomErrorFailed;

typedef enum : NSUInteger {
    ApiStatusSuccess,
    ApiStatusFail,
    ApiStatusError,
    ApiStatusException,
    ApiStatusNetworkNotReachable,
    ApiStatusAppNoUse,
    ApiStatusAccessTokenExpired
} ApiStatus;

@interface AFAppDotNetAPIClient : AFHTTPSessionManager

@property (nonatomic, strong) NSString *access_token;
@property (nonatomic, strong) NSMutableArray *logArr;

+ (instancetype)sharedClient;

//上传文件
-(void)uploadFile:(NSDictionary *)parameters //参数
              Url:(NSString *)url  //url
            Files:(NSArray *)files //文件名列表
           Result:(void (^)(id result_data, id progress, ApiStatus result_status))result //结果block
         Progress:(void (^)(CGFloat progress))progress; //进度

//下载文件
-(void)downloadFile:(NSDictionary *)parameters //参数
           FileUrl:(NSString *)file_url //文件url
             Result:(void (^)(id result_data, ApiStatus result_status))result //结果block
           Progress:(void (^)(CGFloat progress))progress; //进度
//POST
-(void)apiPost:(NSString *)function //api名
    Parameters:(NSDictionary *)parameters //参数
        Result:(void (^)(id result_data, ApiStatus result_status, NSString *api))result; //结果block
//GET
-(void)apiGet:(NSString *)function //api名
   Parameters:(NSDictionary *)parameters //参数
       Result:(void (^)(id result_data, ApiStatus result_status, NSString *api))result; //结果block
//Authorization
-(void)apiAuthorization;
@end
